const AutoFocus = {
  inserted: function(el, binding) {
    el.focus()
  }
}
const install = function(Vue) {
  Vue.directive('focus', AutoFocus)
}

if (window.Vue) {
  window.autoFocus = AutoFocus
  Vue.use(install); // eslint-disable-line
}

AutoFocus.install = install

export default AutoFocus
